package com.xcmg.manage.controller;

import com.xcmg.manage.entity.Staff;
import com.xcmg.manage.feign.EmployeeFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/manage")
public class ManageController {

    @Resource
    EmployeeFeignService employeeFeignService;

    @RequestMapping("/addStaff")

    public String addStaff(Staff staff){
        staff.setName("张斌飞");
        staff.setAge("10");
        staff.setTel("123456");
        staff.setDepartName("智控所");
        int sa=employeeFeignService.addStaff(staff);
        System.out.println("添加1位员工");
        return "成功添加"+sa+"员工";

    }



}
